import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/all',
    component: () => import('../views/all.vue'),
    children:[
        {
          path: '/all/home',
           component: () => import('../views/all/home.vue'),
        },
        {
          path: '/all/classfil',
           component: () => import('../views/all/classfil.vue'),
        },
        {
          path: '/all/shop',
           component: () => import('../views/all/shop.vue'),
        },
        {
          path: '/all/my',
           component: () => import('../views/all/my.vue'),
        },
        {
          path:'/all',
          redirect:'/all/home'
        }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue')
  },
  {
    path: '/detail',
    name: 'detail',
    component: () => import('../views/detail.vue')
  },
  {
    path:'/',
    redirect:'/all'
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
